package homework;

import java.util.Scanner;

abstract class person {
    int age ;
    String name;
    int sex;
}

interface get{
    void get();                      //获取信息
}

interface print {                //输出信息
    void print();
}

class employee extends person implements get,print{
    public void get(){
        Scanner scanner = new Scanner(System.in);
        try {                                               //依次输入信息
            this.name=scanner.nextLine();
            this.age=scanner.nextInt();
            this.sex= scanner.nextInt();
        } catch (Exception e) {
            System.out.println("输入有误");                  //如遇见输入错误则报错
        }
    }
    public void print() {                             //输出员工信息
        if(this.sex==1) System.out.println(this.name+"是男性员工,今年"+this.age+"岁");
        else System.out.println(this.name+"是女性员工,今年"+this.age+"岁");
    }
}

public class homework {
    public static void main(String args[]) {
        employee employee1 = new employee();
        employee employee2 = new employee();
        employee employee3 = new employee();
        Scanner scanner = new Scanner(System.in);
        //输入信息
        System.out.println("请以此输入员工的姓名、年龄与性别（1为男性，0为女性）");
        employee1.get();
        employee2.get();
        employee3.get();
        //输出信息
        employee1.print();
        employee2.print();
        employee3.print();
    }
}